added getEnvironmentVarOrThrow method