example for setting listener from constructor