Fixed issue with for loop in insert, old version might have issues.