Updated to reflect custom event API changes