Added template detail
Fixed template view function