listener now logs errors correctly