changed to filterqueries (no _) and added upgradecheck code.