Had to make some fixes to the updateNodeStatus subroutine.