fix setting status of job twice