Correct CustomEvent emission