detect node the right way