handle invalid query when cal metal