add buffer support