fixed login/logout problems