add closing of tpsChan where needed