read and write data with problem