fix race history race condition