add buffer support for es.wait