save state variables