Fixed error where failed jobs are not requeued properly