Added URL validity checking.