wrap template delete with try/except