Fix the loop missing from wait_for_client()