Wanli Emperor
During the reign of Wanli Emperor, it became a Taoist temple and renamed "Sanyuan Palace".