add state restoration

- state restoration basics added