Added Methode to check if client is connected.