Fixed bugs in triggering