buf fixing