update trigger function