use NUM2SIZET instead of NUM2INT for offset and length