changed time.Sleep to wait group