added login and logout functionality