-fix segmentation fault