fix remain refs to env