added URLError handling