fixed reduce_data