fixed the login functionality