Added update function for the MainPanel