Added support of custom events.