generate listener initialisation only if the listener is generated, too