foreach update