fix race cond