fix massive bug in message generation