remove trailing slash from path