fixing a remain of rand