Fix Segmentation Fault in Linux