added trigger function