Added the destroy call for the mainPanel right before I make a new one