check connection with server before starting the main window

check connection with server before starting the main window
Resize Main Window