bar example with event listener