thread safety upgrades.