hot fix for restoreState