fix duplicating templates when importing multiple records.