deal with buffering