Moved checkURL function