Add cleanup when providing a base url to prevent bad formatting