fix data race introduced by 1798e0f