Added an if statement to when the logout command should be queued.