add testing for existence of domain variables in scope for substitution