finalized the buffer