Added cursor and overrode close event on mainwindow