Need to fix a bug in the assignment of the buffer