modifying bool query to use thedict