Added option to disable/enable buffering