fixed a bug with the destructor / delete