fixed multiple bugs in monitor-nodes.sh