             {
                 if (numExpressions == 1 && !notFlag)
                 {
-                    goodQueries[expression] = true;
+                    goodQueries[originalExpression] = true;
                     return true;                                            
                 }
                 // bail if "and" and no media features (invalid query)

    {
        // 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;

        if (goodQueries[expression]) return true;
        if (badQueries[expression]) return false;
        
        // get a list of queries.  If any pass then
        // we're good

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