Fixed bug at function load_template_file