We suggest a modification of the boundary counterterm method for removing divergences from the action of asymptotically AdS spacetimes. The usual approach gives a finite action, but breaks diffeomorphism invariance. We add a new counterterm that restores this symmetry. The new action yields conserved charges that are consistent with all asymptotic symmetries of the spacetime. In particular, we find a vanishing mass for global AdS, and the correct form of the first law of black hole thermodynamics for the Kerr-AdS solutions.