Fix for undefined event