fix io read and write