done stuffs so main class is assigned when gui button is pressed