fix error segmentation fault