fix error when multi buffers