remove end slash from the path