Processing input, closing the main window works