Check close of TM query, in case it fails