fixed a segmentation core dumped issue