Added a missing 'i' in the for loop