Added code to kill child processes.