add module instance to the mainwindow.