Added a controler for the mainPannel.