improved login-logout