ensure stream always converted to iterator before returning