Hmm... Place it inside of shutdown seems not a good place at second thought. The same reason why we don't want to put it in close(). Maybe place it at all places that calls shutdown(), and right before it. Guo-Fu Tseng