fix offset and length argument