working login and logout