synchronize reloading between threads to avoid errors