fixed bug in template