temporary fix for memory leak in TemplateRemovalRule