fix buf