Added support for handling subpaths