disposed the template resources after using them
Merge pull request #1230 from trilobyte/fix-disposal-of-template-resources

disposed the (template) files/resources after using them