Implemented login and logout