shouldTrigger() function added