opimizing
 save before new state