conditional use of :domain_id for domain and app association