Added ability to dispatch events in-process