adopting USE_HISTORYDB