Fix code style
Don't set the environment variable when it is not accessed.