Handle base url properly