Fixing famous logout bug