updated with login and logout