fixed issues with login/logout