Please check that this.restore is a function before calling it.