Added init for loop and establishConnection()