Added getQuery method