a minor fix for template functionality