added environment variable expansion