chop trailing slash if needed