added advance query