add new function WriteThenRead
remove some assertions in WriteThenRead