Event loop now works for custom events as well