fix template id set bug