float exception fix

fixing a rand % 0 bug.