Updated message creation to be more robust