Solved the segmentation issue