fix bugs in rand processes