fixed for loop bug