Fix for loop error syntax