remove unused variable
remove trailing slash from path