Transaction logic fix for template clone