Why did you can ``$template_name`` to ``$template`` here?