heat: close file before parsing template