Made some changes to the broker to avoid and NPE with the listener list