Restore the state for resuming as well as disconnect