Added polling to ensure job is finished