fixing rand