work on state restoration and some ui changes