prevent IllegalStateExceptions on Countly Analytics