Fixed the templating part