Verifying a proof of martingales. I am trying to prove the following: Let $T$ be a stopping time bounded by $c$, and let $(X_n)$ be a martingale, then $E(X_T)=E(X_0)$.
Here is what I did: 
$\int X_{T}dP=\int\sum_{n=0}^{c}X_n\mathbb{1}_{T=n}dP=\sum_{n=0}^{c}\int_{(T=n)}X_ndP=\sum_{n=0}^{c}\int_{(T=n)}E(X_c|F_n)dP=\sum_{n=0}^{c}\int_{(T=n)}X_cdP=\sum_{n=0}^{c}\int X_{c}\mathbb{1}_{T=n}dP=\int X_{c}dP=\int E(X_c|F_0)dP=\int X_0dP$. 
Is everything alright here? I know $E(X_c|F_0)$ is $F_0$ measurable, whereas $X_c$ is not, have I written everything correctly? 
Thanks for your time.

Yes, it is indeed correct. Maybe the step 
$$\mathbb E\left[\mathbb E[X_c\mid\mathcal F_n]\mathbb 1_{\{T=n\} }\right]=\mathbb E\left[X_c\mathbb 1_{\{T=n\} } \right]$$
could be justified by the fact that $T$ is a stopping time (after all, it seems it is the unique place where we need $T$ to be a stopping time). 
