Suppose we are given a cover $\{U_i\}_{i \in I}$ of a space $X$ and a gluing data $ ( \mathcal{F}_i, \psi_{ij} )_{i,j \in I}$ for the sheaves of sets with respect to this covering. I want to show that there is a sheaf $\mathcal{F}$ on X whose restriction to each $U_i$ is isomorphic to $\mathcal{F_i}$. I have proved it in a direct way i.e. by defining a suitable sheaf that takes open sets of $X$ to compatible tuples and showing that it satisfies all the required properties. Now, there is a hint given in the book I'm following, that is to construct this sheaf by extending a sheaf on a base. And the mentioned base is the collection of open sets which are contained in some $U_i$.
So, if I define right away the sheaf on a base to be $\mathcal{F}^*(u):= \mathcal{F}_i (u)$, where $u\subset U_i$ for some $i\in I$ and the restriction map to be the restriction map of corresponding $U_i$, then the gluability and identity axiom on the base become immediate. However, I'm not sure if this $\mathcal{F}^*$ is well defined, as given $w\subset U_i \cap U_j$, we have $\mathcal{F}_i(w) \cong \mathcal{F}_j(w)$ but not equal. How should i improvise this definition?