fix trailing slash semantics