modify foreach statement