change how to delete object in destructor