Main window appears before connection window (closes #2 and #3)