Added a thread monitor