potential bugfix with virtual destructor