handle IOExceptions.