before adding generated query
generate within query now