fixed login and logout