Fixed a logout not refresh page bug.