removing trailing slash from path