finish advanced querying