got the login/logout at a better position