Fixed logout method