Fixes logout's redirecting issue