throws IOException instead of catch RuntimeException