fix: socket import and connected() method when connection isn't yet created