added connect, disconnect and publish callback functions