added type validation to prevent typos in events from being hidden silently