only emit if there are listeners to prevent uncaught exception