fix buf_size bug