fix bug in shuffle()