Revised message routing logic