throw IOException to handle in the presentation layer