bug fix about i/o