added statistics tracking