remove load dataSource add by addToolbarMenu

Hello,

How to remove specific load dataSource add by addToolbarMenu?

var cartDS = undefined;
var options = [{
  text : '111',
  onselect : function() {
    if (Cesium.defined(cartDS)){
      viewer.dataSources.remove(cartDS)
    };
    cartDS = Cesium.GeoJsonDataSource.load('./SampleData/111.json');
    viewer.dataSources.add(cartDS);
  }
}, {
  text : '222',
  onselect : function() {
    if (Cesium.defined(cartDS)){
      viewer.dataSources.remove(cartDS)
    };
    cartDS = Cesium.GeoJsonDataSource.load('./SampleData/222.json');
    viewer.dataSources.add(cartDS);
  }
}];

Sandcastle.addToolbarMenu(options);

Sandcastle.reset = function() {
  console.log(cartDS);
  viewer.dataSources.remove(cartDS); // dont work
  //viewer.dataSources.removeAll(); // this remove all
};

Thanks

Done!

Sandcastle.reset = function() {
  if (Cesium.defined(cartDS)){
    Cesium.when(cartDS, function(dataSource) {
      viewer.dataSources.remove(dataSource);
    });
  };
};

Thanks