add event definition and fix event queue insertion