hybrid version now will kill child process when program terminates