patch to monitor script