Fixed the login/logout issue