fix building matrix.