key and data var name correction
for loop condition correction