fix a deadlock in shuffle