IDisposable implemented to exit Threads