Use defer for unlocking and comment wg.Add