fixing build matrx