forgot to put destructors as virtual in the previous commit