making the registration of listeners be idempotent