Changed templateDirectory to File