Added getQueryType function