maybe catch IOException only?