add state restoration

- state restoration added