add login/logout function