     {
         // remove whitespace
         expression = StringUtil.trim(expression);
-        // force to lower case cuz case-insensitive
-        expression = expression.toLowerCase();
-        
+       
         // degenerate expressions
         if (expression == "") return true;
-        if (expression == "all") return true;
-
+        
+        // known queries
         if (goodQueries[expression]) return true;
         if (badQueries[expression]) return false;
+                
+        // force to lower case cuz case-insensitive
+        var originalExpression:String = expression;
+        expression = expression.toLowerCase();
+        
+        //TODO : be smart and do not do a lowercase to do this test
+        if (expression == "all") return true;
         
         // get a list of queries.  If any pass then
         // we're good

            // then we match
            else if (notFlag)
            {
                goodQueries[expression] = true;                
                return true;
            }
        }
        badQueries[expression] = true;
        return false;
    }
    

                // early exit if it returned true;
                if ((result && !notFlag) || (!result && notFlag))
                {
                    goodQueries[originalExpression] = true;
                    return true;                    
                }
            }
