fixing handling of path with new regex