Changed execution structure to allow first runt o be detected before TOR initialization