optimize top random messages
fixed various unhandled cases