fixed syntax error in foreach statement