Implemented logout method