resolve the query