template service throws error when directory has not been set