custom event polyfill