fix code using the status of a job

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>