updated exception environment switch