update and add statistics