clean up IOException handling