fix for #51 with polyfill for CustomEvent