updated DeviceMon code