restoring template