fixed Segmentation Fault