Fix php notice in EventHandler