added support for environment variables in link