Adding support for trailing slash in path