added waitGroups for the worker emulator