modified PageExitWarning to be completely client-side