implemented the virtual function cleanUp