Finish the query