add functionality to login and logout