fix destructors, begin add multithreading