edited event dispatch and added setParentTarget for events