Fixing wrong variable name.
Making env variables global as they should been all along.