fix the matrix init