fix a bug
modity val of rand