added support for substitutions