bug fixed: segmentation fault when keyboard interrupt received