fixed state saving and state restoring for jobs using the new structure