fixed the login method.