Fixing a bug where the wrong message was set to the current message