I'm looking at lecture notes on AdS/CFT by Jared Kaplan, and in section 4.2 he claims that the action for a free scalar field in AdS$_3$ is $$S=\int dt d\rho d\theta \dfrac{\sin\rho}{\cos\rho}\dfrac{1}{2}\left[\dot{\phi}^2-\left(\partial_\rho\phi\right)^2-\dfrac{1}{\sin^2\rho}\left(\partial_\theta\phi\right)^2-\dfrac{m^2}{\cos^2\rho}\phi^2\right]$$ and that the canonical momentum conjugate to $\phi$ is $$P_\phi=\dfrac{\delta L}{\delta\dot{\phi}}=\dfrac{\sin\rho}{\cos^2\rho}\dot{\phi}$$ Now, my question is: where do the $\cos^2\rho$ terms in the action and the conjugate momentum come from?
Maybe I'm missing something obvious, but when computing the canonical momentum, shouldn't I only pick up the prefactor of $\frac{\sin\rho}{\cos\rho}$?
As for the mass term in the action, I know that the free scalar field action in AdS$_{d+1}$ is $$S=\int_{AdS}d^{d+1}x\sqrt{-g}\left[\dfrac{1}{2}\left(\nabla_A\phi\right)^2-\dfrac{1}{2}m^2\phi^2\right]$$ with the metric $$ds^2=\dfrac{1}{\cos^2{\rho}}\left(dt^2-d\rho^2-\sin^2{\rho}\ d\Omega_{d-1}^2\right)$$ so how is the mass term picking up an extra $\frac{1}{\cos^2\rho}$?