fix bugs in jobstate