added functionality of login and logout