Add a logout command
Add a function to handle logout