fixed error with login and logout