remove port_rand function.