added support for json messages