modified the compareEvents structure. Some events are getting erased now from unprocessed queue in replenishScheduler().