fix buf in assign condition