Fix a bug of setting job status.