check Tor circuit established; refactoring