Throw IOException instead of RuntimeException