fixed control-c interrupt issue.