added the login/logout functionality