Debugging

fixed $template reference