updated monitor script