added label support to queries