Don't you need some synchronization here, especially for dist mode?