aggregate_data fix