Update a logic for killing child process