added logic to work with json messages