removed unnecessary try-except blocks
added way to add additonal variable encoder when composing messages