CustomEvent bugfix