fix lots bugs of login and init step