use event to update the data on the mainwindow