Improved checking of urls