Adjustments to getUrl function.