add shadow support, fix null login problem