refs #7517 fix foreach loop var