fix IE8 crashes caused by calling document.addEventListener and document.createEvent