bug fix in SIGINT and SIGCHLD