fix cap->buffer