made MatrixError extend from Error