fixed database shuffle bug