adding login and logout functionality