Implemented logging out