change deconstructor to virtual