Added trigger logic