before Delete template