possibly fixed segmentation error