Avoid clash with window.onbeforeunload