Added some threading to the monitor