improved URL checking