Fixed infinite loop on "setEventHandlers"