Fix bug when exiting (love Python threading)