Added optimistic locking for event store