Fixed AttributeError for cases where data_source=None