customEvent polyfill