fix trailing slash adding