the trigger code