fix bug when mult buffers