update jobstateimpl and fix some bugs