Init method for mainwindow