Move the message_dispatch() call after the check for errno on