added callback on template removal