finished destructor and endScan