I am doing the following exercise 2.7D from Ravi Vakil's notes.
Suppose $X = \bigcup U_i$ is an open cover of $X$, and we have sheaves $\mathscr F_i$ on $U_i$ along with isomorphisms $\phi_{ij} : \mathscr F_i|_{U_i \cap U_j} \to \mathscr F_j|_{U_i\cap U_j}$ (with $\phi_{ii}$ the identity) that agree on triple overlaps, i.e., $\phi_{jk} \circ \phi_{ij} = \phi_{ik}$ on $U_i \cap U_j \cap U_k$ (this is called the cocycle condition, for reasons we ignore). Show that these sheaves can be glued together into a sheaf $\mathscr F$ on $X$ (unique up to unique isomorphism), such that $\mathscr F|_{U_i} \cong \mathscr F_i$, and the isomorphisms over $U_i \cap U_j$ are the obvious ones.
The set of all open sets contained in $U_i$ for all $i \in I$, i.e., $\mathcal B=\{B \subset U_i\mid B \text{ is open}\}$, gives me a base for the topology on $X$. I am trying to get a sheaf on the base and from it it can be extended to a sheaf on $X$. I am having trouble defining this sheaf say $F$ on the base.
What I did: If I have an open set of the form $V \subseteq U_i$, then I was going to let $$ F(V) = F_i(V). $$
I thought this was right but I got confused because if $V$ happens to be also contained in $U_j$, then $$ F(V) = F_j(V) $$ also but we only know they are isomorphic to each other and not equal. Could someone please give me a hint as how I can get around this issue?