Final fix with login/logout