avoid NotRegularMatrix error