Fixing #1

Fix for Issue #1 on Messenger plugin. 
Not sure about the Typescript part and if you'd want to add unit tests.