Introduced messageId
Added separate handling of echo and broadcast