ensure trailing slash is preserved