fixed an error in the login method