found bug where messageId is used for two purposes, must fix.