Save state.