fix #24 foreach containing an if statement
Merge pull request #25 from divdavem/foreachWithIfStatement

fix #24 foreach containing an if statement