Added invalidUrl check.