making sure msg_id is in the various dictionaries before deleting