clean up and turn on multithreading