replace length type from union to struct