segmentation fault resolved