Fix listener detection throwing errors