fixed data_write issue
finished merge