fix matrix bug;