fixed i/o errors