Fixing a bug with the logout method.