re-added waitForJobs in examples