lua : prevent double registration of events