prepare for buffering