fix buffering