Preventing double error event emission