new fun: ensureLength