Protects against document.addEventListener errors in old IE