var lastVersionHistoryItem *historyspb.VersionHistoryItem
if len(eventBatches) > 0 {
firstEventVersion = eventBatches[0][0].Version
lastBatch := eventBatches[len(eventBatches)-1]
nextEventID = lastBatch[len(lastBatch)-1].EventId + 1
} else {
currentHistory, err := versionhistory.GetCurrentVersionHistory(ms.executionInfo.VersionHistories)