improve inNode checking