close over the buffer