lua mat type checking