Fixed the iterator issue