Fix bug 1029678: move domain fetch out of async block