Removing dead code
Solve bug at login