avoid exception in destructor