better check programatically built queries for flags