better login and logout