fixed a bug in waitForJobs triggered by a broken template file