Fix the 'trigger is undefined' error