loop query completed