Add missing var in for loop variable declaration