Prevent a js error when update trigger is executed

* opt is an optional value, then it's required to control it before to run an internal function/hook