Fix error handling in checkUrl