adding event listeners and the data publisher