Function $f\in M[G]$, $f:\kappa\to M$ is in the ground model implies $\kappa^+$-Baire Let $M$ be countable transitive model of ZFC, $P\in M$ be poset and $\kappa$ be a cardinal in $M$. In addition, for every $P$-generic filter $G$ over $M$, if a function from $\kappa$ to $M$ is in $M[G]$ then the function is in $M$.
My problem is: $P$ satisfies $\kappa^+$-Baire property in $M$? A poset $P$ satisfies $\alpha$-Baire property if for each $\alpha<\kappa$, the intersection of $\alpha$ many collection of open dense subsets $\{D_\xi:\xi<\alpha\}$ is dense. Also, a subset $D\subset P$  is open dense if $D$ is dense and $D$ is lower set (i.e. $x\in P$ and $y\le x$ then $y\in P$.)
I saw a hint of the problem from Jech, exercises 15.5. However the hint is about Boolean-valued model and I am not familiar with Boolean-valued model. I want to get a proof of above problem not mentioning about Boolean-valued model but I don't know how to start it from Jech's hint. Thanks for any help.


(Jech 15.5) . If every $f : κ → V$ in $V^B$ is in the ground model, then $B$ is $κ$-distributive.
[Let $W_α$, $α<κ$, be partitions of $B$. Consider $\dot f ∈ V^B$ such that  $\|\dot f(α) = u \|= u$ for $u ∈ W_α$, and find a common refinement of the $W_α$.]


Elaborated "Hint":
Let $A_\alpha$ be dense open sets for $\alpha\leq\kappa$, and for each $A_\alpha$ let $D_\alpha$ be a maximal antichain included in $A_\alpha$.
We define the name $\dot f=\{\langle p,(\check\alpha,\check q)^\bullet\rangle\mid p\leq q, q\in D_\alpha\}$. Namely, $p\Vdash\dot f(\check\alpha)=\check q$ if and only if $p\leq q$ and $q\in D_\alpha$. It is easy to see that $1\Vdash\dot f\text{ is a function}, \operatorname{dom}(\dot f)=\check\kappa$.
So for every choice of generic $G$, we know that $\dot f^G\in M$. Therefore there is a maximal antichain $D$ such that for every $q\in D$ there is some $g_q\in M$ such that $q\Vdash\dot f=\check g_q$.
Now, show that if $p\leq q$ and $q\in D$, then it is necessarily the case that $p\in A_\alpha$ for all $\alpha\leq\kappa$, and conclude the wanted density.
