add listener and publisher functions