Correct issue when logging out from certain pages.