more cleanup of i/o