fixed small iteration error