Implement logout handling