Fix more race conditinos