small tweak to directoryiterator