freeing problem environment after use