added System.Threading to mainwindow