world: fix possible deadlock