added end statistics