Obviously, there was no effect on the problem with which this question is concerned, and for which you wrote a procedure which purports to provide a solution. There was no effect on the problem that WML may display a message in the reading pane which does not match the header in the list of messages. Obviously.
Do you have a solution which has an effect?