added buffer support