Modified code to kill all the processes