better handling of listeners