fix restore state bug?