Copy the buffer instead of assigning buffer.