Missing index parameter in for each callback