fixed issue with restores state