file i/o fixed