can now save and restore current state