Add helper function WaitAll