Fixed bug in EventHandler