Fixed error of segmentation