added getQuery method