added type check for mathbynop