Initialize CustomEvent correctly