added template detail code