added login/logout functionality