fixed synchronization between main thread and world thread