- avoid endless loop if attach() is called while the iterator is active