More reliable WaitForExit