Fix "TypeError: Cannot call method trigger of undefined"