fixed restoring state plugin