change in the for loop to fix an issue