fix another subtle state race