Add the trigger function