fixed for loop