Added error handling for the data provider.