fixed waitForProcess