Fix the login and logout