redirect console output to main window