Fix to make sure we are listening before we try to register