fixing shuffling bug