Only emit with callback when defined