Implemented log in and logout