Change custom event to core event with if instance