add signal handler to handle SIGCHLD