fix statistics counting