change mid to msg_id