add error handling to MonitorNode.ts