Bad method call in checkConnection method