Save current state.