investigate null pointer exception thrown in storedEventsCount