fixed error with random