added support for publish, subscribe. fixed crash issue due to bad parsing assumptions