made query generation