checkConnection bug fixed