checking connection inside loop

@arvenil, do you mean `tries uint`? If yes, then we have it there, I'm just sending it to `Connect(tries)` ?