fixed a bug with wrong cluster matrix size