Refactored waitGroup.Done() call.