persist and load environment