change generate query