added codes to exit code

- exit on curl error / http error (not 200)
- prevent endless loop on retrieving domains