resolved segmentation fault