Fixed a minor bug in the monitor script