Made the base class have a virtual destructor