fix bug for html messages, introduced in last refactoring