added statistics collection