clear the enviroment while die