 The price he had to pay, however, was the occupation of Bavaria itself by Austrian troops; and, though the invasion of Bohemia in 1744 by Frederick II of Prussia enabled him to return to Munich, at his death on 20 January 1745 it was left to his successor to make what terms he could for the recovery of his dominions.Maximilian III Joseph (1745–1777), by the peace of Füssen signed on 22 April 1745, obtained the restitution of his dominions in return for a formal acknowledgment of the Pragmatic Sanction.He was a man of enlightenment, did much to encourage agriculture, industries and the exploitation of the mineral wealth of the country, founded the Academy of Sciences at Munich, and abolished the Jesuit censorship of the press.