making reset-env more portable