fixes duplcate foreach key
Merge pull request #1305 from pdewouters/fix-foreach-key

fixes duplcate foreach key