fix template id's to avoid duplicates for successive loads