fix the iterator error