Fix bug on ENV checking