Added monitoring thread