rename mid to messageId