fix a issue with checking whether a path is part of variable