Implemented Login and logout