make script a little more resilient to networking errors