segmentation fault bug Fix