Validating input of addNode