updated joinUrl to preserve leftmost slash