Fixed bug in login system