Add trigger function