Fixed issue of wrong event counts