implementing waitUntil for jobs