Partial derivative in higher dimension .

Let us consider $g: \mathbb R^n \to \mathbb R^m$ , $f:\mathbb R^m \to \mathbb R^k$ be $C^1$ functions . Define $F= f\circ g$. I am having the problem in finding the partial derivative of $F$,

$$\frac {\partial F}{\partial x_i} = \frac{\partial \{f_1(g(x)), .......f_k(g(x)) }{\partial x_i}$$

Let $g(x)=y \in \mathbb R^m$ which is not constant. $$\frac {\partial F}{\partial x_i} = \frac{\partial \{f_1(y), .......f_k(y)}{\partial y} . \frac{\partial y}{\partial x_i}$$

$$=\nabla f_{(g(x))} \cdot \sum_{i=1}^{m} \frac{\partial g_i(x)}{\partial x_i} e_i$$ This doesn't make sense , because the first one has $k$ components and the second term has $m$ components . Can someone point out where i am going wrong ?

-

$F:\mathbb R^n\rightarrow \mathbb R^k$ has $k$-components. Then
$$\frac{\partial F_r}{\partial x_i}(x)=(\text{chain rule})= \sum_{j=1}^m\frac{\partial f_r}{\partial y_j}(g(x))\frac{\partial y_j}{\partial x_i},$$
for all $r\in \{1,\dots,k\}$, where $x=(x_1,\dots,x_n)$ and $y=g(x)\in\mathbb R^m$.