update environment hook