how can we make sure if there are multiple promises(like 5-10) inside a loop running 100 times, how can we make sure all the promises gets resolved before running next cycle of