fix trailing slash in path