add the login/logout function