fix badmatch in send_loop (EJAB-1650)