fixed rare npe after race condition