Added checkUrl function