implemented virtual destructor in the base class