[FIX]Fixed the issue of domain, get_active_domain will not return promise object always hence put $.when