fixed logout method