Who restored the Dalai Lama as a ruler