added login and logout