finish queries