added missing env key
[BUG #8481] improved handler disposal check