foreach template: two ${cursor} variables aren't allowed