mitigate non-thread-safe race condition