fix the state task creation bug