Fix a data overwritten bug for failed jobs