handle trailing slash in argv