In 824, Emperor Muzong died and was succeeded by his son Emperor Jingzong.
Soon thereafter, Wei was made deputy minister of defense, and when he met Emperor Jingzong, who was then spending much time in feasts and games, to thank him, stated, "Your subject has committed a great crime.