Implement basic logout function