Added a check to wait for the proc.kill and see if it was successful