Added error checking for broken ioerror