fix buffer update issue