Update mainwindow.cpp

Bug resolve