freeing statHistory