fixing implementation for iterators