improving the login mechanism