more debugging code in main window