Modified destructor