fix wait for jobs