TEIID-2429 further refining the buffer logic