added fixed monitoring code