save/restore state works now