fix random iterator bug when no items