fix deadlock in shuffle