fixed error in login method