work on login and logout