added checkUrl code