implemented connecttion to MAin in mainFrame