parameterized and fixed buffering issues