fix id before aggregating