update SetEnvVariable
refactoring