fixed bug in stats tracking