added server connection check