What is wrong with the following code. It says "missing $ inserted".
\[f_i(x_0,x_1)(t)=\begin{cases*}p_0(H_i(x_0,x_1,3t)) & if 0\leq t\leq \frac{1}{3} \\\gamma_i(3t-1) & if \frac{1}{3}\leq t\leq \frac{2}{3} \\p_1(H_i(x_0,x_1,3-3t)) & if \frac{2}{3}\leq t\leq 1\end{cases*}\]