treats IOError exception