add locking to stats conversion