monitoring code added