you are right, so we need flush buffers to release all references. added commit