Fixes issue happening when sending JS objects, the message was not getting defined and an empty payload was arriving at the other end