fixed the login and logout