Move env check into config file