Got the kill function to work and properly stop running processes.
Had to change behavior for when a process terminates unexpectedly to us the kill method.