implementing connectToTs
updated destructor