better condition for setting app environment