private function addDirPathIntoLoaderIfNotExists(array $templateDir)
    {
        $paths = $this->loader->getPaths();
        if ((count($paths) !== count($templateDir)) || (0 < count(array_diff($paths, $templateDir)))) {
            $this->loader->removeAllPaths();
            try {
                $this->loader->setPaths($templateDir);
            } catch (\Twig_Error_Loader $e) {}
        }
    }