Async function does not work anymore

Please what is wrong with this code?

async function retrieveAllItemsk() {  
let allItemsk= [];
let hasNextk = true;
let countk = 0
while(hasNextk){
    let resultk = await wixData.query("KERS")
    .isNotEmpty("_owner")
    .limit(1000)
    .skip(countk)
    .find();
    countk += resultk.items.length;
    hasNextk = resultk.hasNext();
    allItemsk.push(resultk.items)
    
}
return allItemsk[0]
}

(async () => {

let allItemex6 = await retrieveAllItemsk()//[resser6[0].items].flat()
let entry6 = allItemex6.length

let updatinnng={//update 
 "name":"totalEntries",
// "total":(allItemex9.length).toString(),
 "total":(allItemex6.length).toString(),

}
     
          wixData.save("ITOTAL", updatinnng)
        .then((result) => {
          let item = result; //see item below
        })

 .catch((err) => {
 let errorMsg = err;
            });
})