Recursion trying to check if connected.