re-implemented login/logout