added connection type to publish messages