fix dimension of label matrix