fix crash with result iterator when the iterator exists longer than the