fixed typo in for loop