add login and logout functions