foreach statement added