minor changes to queries