added support for CustomEvent() API