Fix stupid error
Fix crash on exit if loading thread is running