[reference] add foreach callback