Fix the checking logic whether ENV is set of not