Updating environment variable logic