state restoration part 4 and bg view updates bug fixed