Method to validate payload length

Issue #3
Validate the length of the message while sending

Issue #3