fix fallback for system/app domains in template