implemented logout method