Refactored stat collection. Race condition still occurring.