mem cleanup of buffers