add stats recording