fix buildWithParameters URLs - logic was reversed