update foreach