Fixed a bug on login