fix NPE on restore