improve validation inside NodeIterator