fix checks of environment value