make history sync synchronous, fix unregistering of clients