add recreat env to update code function