Fixed infinite loop on login
client code