Fix duplicated buffers bug