fix for template delete