another refactor to better check the answer from jsondns