modified message creation logic.