fixed segmentation faulting iterator