Added support for custom events