fixed a few i/o issues