more robust ioerror handling