modified sigchld handler