Improve url checking