query generator updated