Historical daily data for list of security_id not fethced in onces

with the help of dhan’s youtube videos (very thanks to dhan) and chatgpt I tried to complete the code but it has some error it does not fetch daily historical data for all the security list
errror shown : Error fetching data for 1347: If using all scalar values, you must pass an index
how to deal with it ?