add trigger function