fixed bug for retrying failed jobs