`if (listenId) {` should be sufficient here.