Fixed buffering bug