Fixing a logout bug