Fix set env failed problem