Changes from Xing Xing for the waitGroup.Done() call