fixes for template id