added validateUrl method