Update trigger function